package com.wuxi.scheduler.clients;

import com.wuxi.scheduler.pojo.seer.*;
import feign.Headers;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author 33879
 */
@FeignClient(name = "seer-robots-service",url = "${seer.rds.address}")
public interface SEERRobotsClient {

    /**
     * 创建运单
     */
    @PostMapping("/setOrder")
    @Headers("Content-Type: application/json")
    SeerRobotOrderResponse setOrder(@RequestBody Order order);

    /**
     * 终止多个运单-通过订单
     */
    @PostMapping("/terminate")
    SeerRobotBaseResponse terminateOrderId(@RequestBody TerminalIdListOrder terminalOrder);

    /**
     * 终止多个运单-通过机器人
     */
    @PostMapping("/terminate")
    SeerRobotBaseResponse terminateOrderVechile(@RequestBody TerminalVehiclesOrder terminalVehiclesOrder);

    /**
     *  修改运单优先级
     */
    @PostMapping("/setPriority")
    SeerRobotBaseResponse setPriority(@RequestBody Pirority priority);

    /**
     *  运单封口
     */
    @PostMapping("/markComplete")
    @Headers("Content-Type: application/json")
    SeerRobotBaseResponse markComplete(@RequestBody OrderComplete order);


    /**
     * 通过运单号查询运单状态
     */
    @GetMapping("/orderDetails/{id}")
    SeerOrderStatusResponse orderDetails(@PathVariable("id") String id,@RequestParam("paths") String paths);


    /**
     *  追加运单的动作块
     */
    @PostMapping("/addBlocks")
    SeerRobotBaseResponse addBlocks(@RequestBody Order order);


    /**
     * 获取机器人信息
     */
    @GetMapping("/robotsStatus")
    SeerRobotAlarmResponse getRobotsStatus(@RequestParam("paths") String paths);

    /**
     * 获取机器人的控制权
     */
    @PostMapping("/lock")
    SeerRobotBaseResponse lock(@RequestBody List<String> vehicles);

    /**
     * 暂停机器人导航
     */
    @PostMapping("/gotoSitePause")
    SeerRobotBaseResponse gotoSitePause(@RequestBody List<String> vehicles);

    /**
     * 释放机器人的控制权
     */
    @PostMapping("/unlock")
    SeerRobotBaseResponse unlock(@RequestBody List<String> vehicles);

    /**
     * 继续机器人的导航任务
     */
    @PostMapping("/gotoSiteResume")
    SeerRobotBaseResponse gotoSiteResume(@RequestBody List<String> vehicles);
}
